//
//  ExtensionCollectionViewCell.m
//  UIHomeWork19_汽车之家找车页
//
//  Created by tusm on 16/8/10.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ExtensionCollectionViewCell.h"
#import "ExtensionList.h"
#import "UIImageView+WebCache.h"
@interface ExtensionCollectionViewCell()
@property (nonatomic,strong)UIImageView *pic;
@property (nonatomic,strong)UILabel *nameLabel;
@end



@implementation ExtensionCollectionViewCell
- (void)setExtensionList:(ExtensionList *)extensionList{

    _extensionList = extensionList;
    [_pic sd_setImageWithURL:[NSURL URLWithString:_extensionList.img]];
    _nameLabel.text = _extensionList.seriesname;

}

- (instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:self.bounds];
    if (self) {
        _pic = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_pic];
//        _pic.backgroundColor = [UIColor redColor];
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectZero];
//        _nameLabel.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_nameLabel];
    }
    return self;
}

- (void)layoutSubviews{

    [super layoutSubviews];
    _pic.frame = CGRectMake(5, 5, 90, 100);
    _nameLabel.frame = CGRectMake(5, 105, 90, 40);
    _nameLabel.textAlignment = NSTextAlignmentCenter;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

@end
